cmake_minimum_required(VERSION 3.7)
project(skynet)

set(CMAKE_CXX_STANDARD 11)

include_directories(lualib-src/sproto/)
include_directories(lualib-src/)
include_directories(service-src/)
include_directories(skynet-src/)


include_directories(3rd/lpeg/)
include_directories(3rd/lua/)
include_directories(3rd/lua-md5/)

include_directories(3rd/jemalloc/include/jemalloc/)
# include_directories(3rd/jemalloc/include/jemalloc/internal/)
# include_directories(3rd/jemalloc/include/msvc_compat/C99/)
# include_directories(3rd/jemalloc/include/msvc_compat/)
# include_directories(3rd/jemalloc/msvc/projects/vc2015/test_threads/)
# include_directories(3rd/jemalloc/test/include/test/)

set(SOURCE_FILES
        3rd/jemalloc/include/jemalloc/internal/arena.h
        3rd/jemalloc/include/jemalloc/internal/assert.h
        3rd/jemalloc/include/jemalloc/internal/atomic.h
        3rd/jemalloc/include/jemalloc/internal/base.h
        3rd/jemalloc/include/jemalloc/internal/bitmap.h
        3rd/jemalloc/include/jemalloc/internal/chunk.h
        3rd/jemalloc/include/jemalloc/internal/chunk_dss.h
        3rd/jemalloc/include/jemalloc/internal/chunk_mmap.h
        3rd/jemalloc/include/jemalloc/internal/ckh.h
        3rd/jemalloc/include/jemalloc/internal/ctl.h
        3rd/jemalloc/include/jemalloc/internal/extent.h
        3rd/jemalloc/include/jemalloc/internal/hash.h
        3rd/jemalloc/include/jemalloc/internal/huge.h
        3rd/jemalloc/include/jemalloc/internal/jemalloc_internal.h
        3rd/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h
        3rd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
        3rd/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h
        3rd/jemalloc/include/jemalloc/internal/mb.h
        3rd/jemalloc/include/jemalloc/internal/mutex.h
        3rd/jemalloc/include/jemalloc/internal/nstime.h
        3rd/jemalloc/include/jemalloc/internal/pages.h
        3rd/jemalloc/include/jemalloc/internal/ph.h
        3rd/jemalloc/include/jemalloc/internal/private_namespace.h
        3rd/jemalloc/include/jemalloc/internal/private_unnamespace.h
        3rd/jemalloc/include/jemalloc/internal/prng.h
        3rd/jemalloc/include/jemalloc/internal/prof.h
        3rd/jemalloc/include/jemalloc/internal/public_namespace.h
        3rd/jemalloc/include/jemalloc/internal/public_unnamespace.h
        3rd/jemalloc/include/jemalloc/internal/ql.h
        3rd/jemalloc/include/jemalloc/internal/qr.h
        3rd/jemalloc/include/jemalloc/internal/quarantine.h
        3rd/jemalloc/include/jemalloc/internal/rb.h
        3rd/jemalloc/include/jemalloc/internal/rtree.h
        3rd/jemalloc/include/jemalloc/internal/size_classes.h
        3rd/jemalloc/include/jemalloc/internal/smoothstep.h
        3rd/jemalloc/include/jemalloc/internal/stats.h
        3rd/jemalloc/include/jemalloc/internal/tcache.h
        3rd/jemalloc/include/jemalloc/internal/ticker.h
        3rd/jemalloc/include/jemalloc/internal/tsd.h
        3rd/jemalloc/include/jemalloc/internal/util.h
        3rd/jemalloc/include/jemalloc/internal/valgrind.h
        3rd/jemalloc/include/jemalloc/internal/witness.h
        3rd/jemalloc/include/jemalloc/jemalloc.h
        3rd/jemalloc/include/jemalloc/jemalloc_defs.h
        3rd/jemalloc/include/jemalloc/jemalloc_macros.h
        3rd/jemalloc/include/jemalloc/jemalloc_mangle.h
        3rd/jemalloc/include/jemalloc/jemalloc_mangle_jet.h
        3rd/jemalloc/include/jemalloc/jemalloc_protos.h
        3rd/jemalloc/include/jemalloc/jemalloc_protos_jet.h
        3rd/jemalloc/include/jemalloc/jemalloc_rename.h
        3rd/jemalloc/include/jemalloc/jemalloc_typedefs.h
        3rd/jemalloc/include/msvc_compat/C99/stdbool.h
        3rd/jemalloc/include/msvc_compat/C99/stdint.h
        3rd/jemalloc/include/msvc_compat/strings.h
        3rd/jemalloc/include/msvc_compat/windows_extra.h
        3rd/jemalloc/msvc/projects/vc2015/test_threads/test_threads.cpp
        3rd/jemalloc/msvc/projects/vc2015/test_threads/test_threads.h
        3rd/jemalloc/msvc/projects/vc2015/test_threads/test_threads_main.cpp
        3rd/jemalloc/src/arena.c
        3rd/jemalloc/src/atomic.c
        3rd/jemalloc/src/base.c
        3rd/jemalloc/src/bitmap.c
        3rd/jemalloc/src/chunk.c
        3rd/jemalloc/src/chunk_dss.c
        3rd/jemalloc/src/chunk_mmap.c
        3rd/jemalloc/src/ckh.c
        3rd/jemalloc/src/ctl.c
        3rd/jemalloc/src/extent.c
        3rd/jemalloc/src/hash.c
        3rd/jemalloc/src/huge.c
        3rd/jemalloc/src/jemalloc.c
        3rd/jemalloc/src/mb.c
        3rd/jemalloc/src/mutex.c
        3rd/jemalloc/src/nstime.c
        3rd/jemalloc/src/pages.c
        3rd/jemalloc/src/prng.c
        3rd/jemalloc/src/prof.c
        3rd/jemalloc/src/quarantine.c
        3rd/jemalloc/src/rtree.c
        3rd/jemalloc/src/stats.c
        3rd/jemalloc/src/tcache.c
        3rd/jemalloc/src/ticker.c
        3rd/jemalloc/src/tsd.c
        3rd/jemalloc/src/util.c
        3rd/jemalloc/src/valgrind.c
        3rd/jemalloc/src/witness.c
        3rd/jemalloc/src/zone.c
        3rd/jemalloc/test/include/test/btalloc.h
        3rd/jemalloc/test/include/test/jemalloc_test.h
        3rd/jemalloc/test/include/test/jemalloc_test_defs.h
        3rd/jemalloc/test/include/test/math.h
        3rd/jemalloc/test/include/test/mq.h
        3rd/jemalloc/test/include/test/mtx.h
        3rd/jemalloc/test/include/test/SFMT-alti.h
        3rd/jemalloc/test/include/test/SFMT-params.h
        3rd/jemalloc/test/include/test/SFMT-params11213.h
        3rd/jemalloc/test/include/test/SFMT-params1279.h
        3rd/jemalloc/test/include/test/SFMT-params132049.h
        3rd/jemalloc/test/include/test/SFMT-params19937.h
        3rd/jemalloc/test/include/test/SFMT-params216091.h
        3rd/jemalloc/test/include/test/SFMT-params2281.h
        3rd/jemalloc/test/include/test/SFMT-params4253.h
        3rd/jemalloc/test/include/test/SFMT-params44497.h
        3rd/jemalloc/test/include/test/SFMT-params607.h
        3rd/jemalloc/test/include/test/SFMT-params86243.h
        3rd/jemalloc/test/include/test/SFMT-sse2.h
        3rd/jemalloc/test/include/test/SFMT.h
        3rd/jemalloc/test/include/test/test.h
        3rd/jemalloc/test/include/test/thd.h
        3rd/jemalloc/test/include/test/timer.h
        3rd/jemalloc/test/integration/aligned_alloc.c
        3rd/jemalloc/test/integration/allocated.c
        3rd/jemalloc/test/integration/chunk.c
        3rd/jemalloc/test/integration/mallocx.c
        3rd/jemalloc/test/integration/MALLOCX_ARENA.c
        3rd/jemalloc/test/integration/overflow.c
        3rd/jemalloc/test/integration/posix_memalign.c
        3rd/jemalloc/test/integration/rallocx.c
        3rd/jemalloc/test/integration/sdallocx.c
        3rd/jemalloc/test/integration/thread_arena.c
        3rd/jemalloc/test/integration/thread_tcache_enabled.c
        3rd/jemalloc/test/integration/xallocx.c
        3rd/jemalloc/test/src/btalloc.c
        3rd/jemalloc/test/src/btalloc_0.c
        3rd/jemalloc/test/src/btalloc_1.c
        3rd/jemalloc/test/src/math.c
        3rd/jemalloc/test/src/mq.c
        3rd/jemalloc/test/src/mtx.c
        3rd/jemalloc/test/src/SFMT.c
        3rd/jemalloc/test/src/test.c
        3rd/jemalloc/test/src/thd.c
        3rd/jemalloc/test/src/timer.c
        3rd/jemalloc/test/stress/microbench.c
        3rd/jemalloc/test/unit/a0.c
        3rd/jemalloc/test/unit/arena_reset.c
        3rd/jemalloc/test/unit/atomic.c
        3rd/jemalloc/test/unit/bitmap.c
        3rd/jemalloc/test/unit/ckh.c
        3rd/jemalloc/test/unit/decay.c
        3rd/jemalloc/test/unit/fork.c
        3rd/jemalloc/test/unit/hash.c
        3rd/jemalloc/test/unit/junk.c
        3rd/jemalloc/test/unit/junk_alloc.c
        3rd/jemalloc/test/unit/junk_free.c
        3rd/jemalloc/test/unit/lg_chunk.c
        3rd/jemalloc/test/unit/mallctl.c
        3rd/jemalloc/test/unit/math.c
        3rd/jemalloc/test/unit/mq.c
        3rd/jemalloc/test/unit/mtx.c
        3rd/jemalloc/test/unit/nstime.c
        3rd/jemalloc/test/unit/ph.c
        3rd/jemalloc/test/unit/prng.c
        3rd/jemalloc/test/unit/prof_accum.c
        3rd/jemalloc/test/unit/prof_active.c
        3rd/jemalloc/test/unit/prof_gdump.c
        3rd/jemalloc/test/unit/prof_idump.c
        3rd/jemalloc/test/unit/prof_reset.c
        3rd/jemalloc/test/unit/prof_thread_name.c
        3rd/jemalloc/test/unit/ql.c
        3rd/jemalloc/test/unit/qr.c
        3rd/jemalloc/test/unit/quarantine.c
        3rd/jemalloc/test/unit/rb.c
        3rd/jemalloc/test/unit/rtree.c
        3rd/jemalloc/test/unit/run_quantize.c
        3rd/jemalloc/test/unit/SFMT.c
        3rd/jemalloc/test/unit/size_classes.c
        3rd/jemalloc/test/unit/smoothstep.c
        3rd/jemalloc/test/unit/stats.c
        3rd/jemalloc/test/unit/ticker.c
        3rd/jemalloc/test/unit/tsd.c
        3rd/jemalloc/test/unit/util.c
        3rd/jemalloc/test/unit/witness.c
        3rd/jemalloc/test/unit/zero.c
        3rd/lpeg/lpcap.c
        3rd/lpeg/lpcap.h
        3rd/lpeg/lpcode.c
        3rd/lpeg/lpcode.h
        3rd/lpeg/lpprint.c
        3rd/lpeg/lpprint.h
        3rd/lpeg/lptree.c
        3rd/lpeg/lptree.h
        3rd/lpeg/lptypes.h
        3rd/lpeg/lpvm.c
        3rd/lpeg/lpvm.h
        3rd/lua/lapi.c
        3rd/lua/lapi.h
        3rd/lua/lauxlib.c
        3rd/lua/lauxlib.h
        3rd/lua/lbaselib.c
        3rd/lua/lbitlib.c
        3rd/lua/lcode.c
        3rd/lua/lcode.h
        3rd/lua/lcorolib.c
        3rd/lua/lctype.c
        3rd/lua/lctype.h
        3rd/lua/ldblib.c
        3rd/lua/ldebug.c
        3rd/lua/ldebug.h
        3rd/lua/ldo.c
        3rd/lua/ldo.h
        3rd/lua/ldump.c
        3rd/lua/lfunc.c
        3rd/lua/lfunc.h
        3rd/lua/lgc.c
        3rd/lua/lgc.h
        3rd/lua/linit.c
        3rd/lua/liolib.c
        3rd/lua/llex.c
        3rd/lua/llex.h
        3rd/lua/llimits.h
        3rd/lua/lmathlib.c
        3rd/lua/lmem.c
        3rd/lua/lmem.h
        3rd/lua/loadlib.c
        3rd/lua/lobject.c
        3rd/lua/lobject.h
        3rd/lua/lopcodes.c
        3rd/lua/lopcodes.h
        3rd/lua/loslib.c
        3rd/lua/lparser.c
        3rd/lua/lparser.h
        3rd/lua/lprefix.h
        3rd/lua/lstate.c
        3rd/lua/lstate.h
        3rd/lua/lstring.c
        3rd/lua/lstring.h
        3rd/lua/lstrlib.c
        3rd/lua/ltable.c
        3rd/lua/ltable.h
        3rd/lua/ltablib.c
        3rd/lua/ltm.c
        3rd/lua/ltm.h
        3rd/lua/lua.c
        3rd/lua/lua.h
        3rd/lua/lua.hpp
        3rd/lua/luac.c
        3rd/lua/luaconf.h
        3rd/lua/lualib.h
        3rd/lua/lundump.c
        3rd/lua/lundump.h
        3rd/lua/lutf8lib.c
        3rd/lua/lvm.c
        3rd/lua/lvm.h
        3rd/lua/lzio.c
        3rd/lua/lzio.h
        3rd/lua-md5/compat-5.2.c
        3rd/lua-md5/compat-5.2.h
        3rd/lua-md5/md5.c
        3rd/lua-md5/md5.h
        3rd/lua-md5/md5lib.c
        lualib-src/sproto/lsproto.c
        lualib-src/sproto/msvcint.h
        lualib-src/sproto/sproto.c
        lualib-src/sproto/sproto.h
        lualib-src/lsha1.c
        lualib-src/lua-bson.c
        lualib-src/lua-clientsocket.c
        lualib-src/lua-cluster.c
        lualib-src/lua-crypt.c
        lualib-src/lua-debugchannel.c
        lualib-src/lua-memory.c
        lualib-src/lua-mongo.c
        lualib-src/lua-multicast.c
        lualib-src/lua-mysqlaux.c
        lualib-src/lua-netpack.c
        lualib-src/lua-profile.c
        lualib-src/lua-seri.c
        lualib-src/lua-seri.h
        lualib-src/lua-sharedata.c
        lualib-src/lua-skynet.c
        lualib-src/lua-socket.c
        lualib-src/lua-stm.c
        service-src/databuffer.h
        service-src/hashid.h
        service-src/service_gate.c
        service-src/service_harbor.c
        service-src/service_logger.c
        service-src/service_snlua.c
        skynet-src/atomic.h
        skynet-src/luashrtbl.h
        skynet-src/malloc_hook.c
        skynet-src/malloc_hook.h
        skynet-src/rwlock.h
        skynet-src/skynet.h
        skynet-src/skynet_daemon.c
        skynet-src/skynet_daemon.h
        skynet-src/skynet_env.c
        skynet-src/skynet_env.h
        skynet-src/skynet_error.c
        skynet-src/skynet_handle.c
        skynet-src/skynet_handle.h
        skynet-src/skynet_harbor.c
        skynet-src/skynet_harbor.h
        skynet-src/skynet_imp.h
        skynet-src/skynet_log.c
        skynet-src/skynet_log.h
        skynet-src/skynet_main.c
        skynet-src/skynet_malloc.h
        skynet-src/skynet_module.c
        skynet-src/skynet_module.h
        skynet-src/skynet_monitor.c
        skynet-src/skynet_monitor.h
        skynet-src/skynet_mq.c
        skynet-src/skynet_mq.h
        skynet-src/skynet_server.c
        skynet-src/skynet_server.h
        skynet-src/skynet_socket.c
        skynet-src/skynet_socket.h
        skynet-src/skynet_start.c
        skynet-src/skynet_timer.c
        skynet-src/skynet_timer.h
        skynet-src/socket_epoll.h
        skynet-src/socket_kqueue.h
        skynet-src/socket_poll.h
        skynet-src/socket_server.c
        skynet-src/socket_server.h
        skynet-src/spinlock.h
        )

add_executable(skynet ${SOURCE_FILES})